﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Net5ApiANdWpfClient.Lib.Model
{
    public class BaseModel : INotifyPropertyChanged
    {
		#region 属性变化通知事件

		/// <summary>
		/// 属性变化通知事件
		/// </summary>
		public event PropertyChangedEventHandler PropertyChanged;

		/// <summary>
		/// 属性变化通知
		/// </summary>
		/// <param name="e"></param>
		public void OnPropertyChanged(PropertyChangedEventArgs e)
		{
			//if (PropertyChanged != null)
			//{
			//	PropertyChanged(this, e);
			//}
			PropertyChanged?.Invoke(this, e);
			
		}

		/// <summary>
		/// 属性变化通知事件
		/// </summary>
		/// <param name="PropertyName"></param>
		public void OnPropertyChanged(string PropertyName)
		{
			PropertyChangedEventArgs e = new PropertyChangedEventArgs(PropertyName);
			OnPropertyChanged(e);
		}

		#endregion
	}
}
